<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录页面</title>
</head>
<body>
<h1>用户登录</h1>
<form th:action="@{/login}" method="post">
    <input type="hidden" name="grant_type" value="password"/>
    <!-- 隐藏字段，传递 redirect 参数 -->
    <input type="hidden" name="redirect" value="${redirect}">
    <div>
        <label>用户名:</label>
        <label>
            <input type="text" name="username" required>
        </label>
    </div>
    <div>
        <label>密码:</label>
        <label>
            <input type="password" name="password" required>
        </label>
    </div>
    <button type="submit">登录</button>
</form>
<p th:text="${message}" style="color:red;"></p>
</body>
</html>
